/**
 * @author dss
 * domain 即为 name domain 为当前引用该名字的复合system
 * ExNS === extend name space
 */
_dss_editor._namespace.findSysInDomain = function(name, domain) {
	//var fullName =  domain.getFullName? domain.getFullName() + '.' + name:name;
	var sys = _dss_editor._toolkit.findSystemByName(domain.getChildren(), name);
	if (sys) {
		return sys;
	} else {
		return null;
	}
};

_dss_editor._namespace.findSysInExNS = function(name, domain) {
	var sys = this.findSysInDomain(name, domain);
	if (!sys && domain.style != STYLE_ROOT) {
		domain = domain.parent;
		sys = this.findSysInExNS(name, domain);
	}
	return sys;
};
/*
 * 找到头字母匹配的相关名字的集合
 */
_dss_editor._namespace.matchNames = function(str, domain,isFixedDomain) {
	var names = [];
	for (var i = 0; i < domain.getChildren().length; i++) {
		var sub = domain.getChildren()[i];
		if (sub.name.search('^' + str + '\\w*') === 0) {
			names.push(sub.name);
		}
	}
	if (domain.style != STYLE_ROOT && !isFixedDomain) {
		names = names.concat(this.matchNames(str, domain.parent));
	}
	names.sort();
	return names;
};

//检查冲突，如有冲突抛出异常
_dss_editor._namespace.checkConflict = function() {

};
